package com.je.app.persistence;

import java.util.List;

import org.hibernate.Session;

import com.je.app.model.Habitacion;

public class DaoHabitacion extends DaoGeneric{

	private static DaoHabitacion instance = new DaoHabitacion();

	public static DaoHabitacion getInstance() {

		return instance;
	}

	private DaoHabitacion() {

	}

	public boolean permiteEliminar(String nombreTipoHabitacion) {
    	Session session = HibernateUtil.getSession();
        session.beginTransaction();
        List<Habitacion> list = session.createQuery("FROM Habitacion WHERE tipo='"+nombreTipoHabitacion+"'").list();
        session.getTransaction().commit();
        if(list.size()==0) return true;
        else return false;
     
	}
}
